/* ===================================
   图像展示区样式
   =================================== */

#image-display-area {
  flex-grow: 2.4;
  padding: 20px;
  margin-left: 340px;
  margin-right: 240px;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#image-display-area .card {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 25px;
  text-align: center;
  flex-grow: 0;
  margin-bottom: 25px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#image-display-area .card:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

/* 上传区域 */
#image-display-area #upload-section {
  flex: 0 0 auto;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

#image-display-area #upload-section #drop-area {
  border: 2px dashed #b0bec5;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  color: #546e7a;
  margin-bottom: 15px;
  width: 85%;
  margin-left: auto;
  margin-right: auto;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background-color: #f7fafc;
}

#image-display-area #upload-section #drop-area:hover {
  border-color: #3498db;
  background-color: #ecf5fe;
  transform: translateY(-3px);
}

#image-display-area #upload-section #drop-area.highlight {
  border-color: #3498db;
  background-color: #ecf5fe;
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
}

#image-display-area #upload-section #drop-area p {
  font-size: 1.1em;
  margin: 10px 0;
}

/* 结果区域 */
#image-display-area #result-section {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#image-display-area #result-section .image-container {
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  text-align: center;
}

#image-display-area #result-section #translatedImageDisplay {
  position: relative;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border: none;
  transition: width 0.3s ease;
}

/* 图像控制 */
#image-display-area #result-section .image-controls {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

/* 文本信息区 */
#image-display-area #result-section .text-info {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 4px;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.9em;
  text-align: left;
  overflow-x: auto;
  height: 300px;
  overflow-y: auto;
}

/* 下载按钮区 */
#image-display-area #result-section .download-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
  width: 100%;
  flex-wrap: wrap;
}

.download-all-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.download-format-selector {
  width: auto;
  max-width: 150px;
}

.download-format-selector select {
  width: 100%;
  padding: 10px;
  border: 1px solid #e0e6ed;
  border-radius: 8px;
  font-size: 0.9em;
  background-color: #f8fafc;
  margin-top: 5px;
  transition: border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.download-format-selector select:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  outline: none;
}

#image-display-area #result-section .download-buttons button {
  display: none;
  padding: 12px 20px;
  background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  margin-top: 0;
  transition: all 0.3s ease;
  min-width: 150px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
  position: relative;
  overflow: hidden;
}

#image-display-area #result-section .download-buttons button:hover {
  background: linear-gradient(135deg, #1f6aa6 0%, #3498db 100%);
  box-shadow: 0 6px 10px rgba(52, 152, 219, 0.3);
  transform: translateY(-2px);
}

#image-display-area #result-section .download-buttons button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.7s;
}

#image-display-area #result-section .download-buttons button:hover:before {
  left: 100%;
}

/* 导出/导入文本按钮样式 */
#exportTextButton, #importTextButton {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
  box-shadow: 0 4px 6px rgba(46, 204, 113, 0.2) !important;
}

#exportTextButton:hover, #importTextButton:hover {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
  box-shadow: 0 6px 10px rgba(46, 204, 113, 0.3) !important;
}

/* 加载和错误消息 */
#image-display-area #upload-section #loadingMessage,
#image-display-area #upload-section .error-message {
  margin-top: 15px;
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 1em;
}

#image-display-area #upload-section #loadingMessage:before {
  content: '处理中...';
}

#image-display-area #upload-section .error-message {
  color: #c53030;
  background-color: #fff5f5;
  border-left: 4px solid #fc8181;
  font-weight: bold;
}

#image-display-area #upload-section .loader {
  display: none;
}

/* 翻译/下载消息（隐藏） */
#translatingMessage, #downloadingMessage {
  display: none !important;
}

#result-section p#translatingMessage {
  margin-top: 10px;
  font-style: italic;
  color: #777;
  text-align: center;
  display: none;
}

#result-section p#downloadingMessage {
  margin-top: 10px;
  font-style: italic;
  color: #777;
  text-align: center;
  display: none;
}

/* 气泡高亮效果 */
.highlight-bubble {
  position: absolute;
  border: 1px solid #2980b9;
  pointer-events: auto;
  z-index: 1000;
  border-radius: 5px;
  box-sizing: border-box;
  overflow: visible !important;
  cursor: pointer;
}

.highlight-bubble.selected {
  border: 1px solid #e74c3c;
}

@keyframes pulse-border {
  0% { border-color: #e74c3c; }
  50% { border-color: #ff6b6b; }
  100% { border-color: #e74c3c; }
}
